package com.dk.consumer;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

//@Component
@Service
@RocketMQMessageListener(topic = "test-topic1",consumerGroup = "my-consumer")
public class RocketMQConsumer implements RocketMQListener<String> { //泛型 ： 发送的消息时什么类型 这里就是什么泛型

    @Override
    public void onMessage(String s) {
        //s就是接收到的消息
        System.out.println("接收到的消息："+ s);
    }
}
